package com.macrounion.atv.controller.api;

import com.macrounion.atv.service.dto.req.DeviceReqDto;
import com.macrounion.atv.service.dto.req.DeviceStatusReqDto;
import com.macrounion.atv.service.dto.resp.DeviceListRespDto;
import com.macrounion.atv.service.dto.resp.SpotListRespDto;
import com.macrounion.atv.service.entity.ext.DeviceStatusExt;
import com.macrounion.base.service.dto.PageRespDto;
import org.springframework.web.bind.annotation.*;

import com.macrounion.atv.processor.DeviceProcessor;
import com.macrounion.atv.service.entity.Device;
import com.macrounion.atv.service.entity.User;
import com.macrounion.atv.service.service.DeviceService;
import com.macrounion.base.controller.api.BaseApiController;

import java.util.List;

@RestController
@RequestMapping("/api/device")
public class DeviceApiController extends BaseApiController<Device, Device, DeviceProcessor, DeviceService, Device,User> {

    @GetMapping("/getDeviceBySpotId")
    public List<Device> getDeviceBySpotId(String spotId){
        return processor.getDeviceBySpotId(spotId);
    }


    @PostMapping("/requestPageList")
    public PageRespDto<DeviceListRespDto> getDeviceList(@RequestBody DeviceReqDto deviceReqDto){
        return processor.getDeviceList(deviceReqDto);
    }

    @PostMapping("/requestStatusPageList")
    public PageRespDto<DeviceStatusExt> getStatusList(@RequestBody DeviceStatusReqDto deviceStatusReqDto){
        return processor.getStatusList(deviceStatusReqDto);
    }

    @GetMapping("/getAllDevice")
    public List<Device> getAllDevice(){
        return processor.getAllDevice();
    }

    @GetMapping("/getDevicesToVisual")
    public List<Device> getDevicesToVisual(Device device){
        return processor.getDevicesToVisual(device);
    }

}